/**
 * @author              : Leif H. Larsen
 * @creationdate        : 25/10/2011
 * @lastchanged         : 25/10/2011
 * @name                : iPhone.js
 * @description         : 
 */

/**
 * TODO:
 * 
 */
window.addEventListener('load', setOrientation, false);
window.addEventListener('orientationchange', setOrientation, false);

window.addEventListener('load', function(){
  setTimeout(scrollTo, 0, 0, 1);
}, false);

function setOrientation() {
    var orient = Math.abs(window.orientation) == 90 ? 'landscape' : 'portrait';
    var cl = document.body.className; 
    cl = cl.replace(/portrait|landscape/, orient);
    document.body.className = cl;
}